package com.jungle.sp.daily.entity;

import com.fasterxml.jackson.annotation.JsonView;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    public interface PublicView {
    }

    ;

    public interface InternalView extends PublicView {
    }

    ;
    @JsonView(PublicView.class)
    private Long id;
    @JsonView(PublicView.class)
    private String name;
    @JsonView(PublicView.class)
    private String address;
    @JsonView(InternalView.class)
    private String password;
    @JsonView(InternalView.class)
    private String idCard;
    @JsonView(PublicView.class)
    private String email;

    // 下面这种需要yaml中配置全局 spring.jackson.mapper.default-view-inclusion=true
    // private Long id ;
    // private String name ;
    // private String address ;
    // @JsonView(InternalView.class)
    // private String password ;
    // @JsonView(InternalView.class)
    // private String idCard ;
    // private String email ;
}